<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    <title>Anim example:</title>
    <link rel="stylesheet" type="text/css" href="../example.css" />
  </head>
<body>
<div id="doc4">
  <div class="hd">
    <div class="hd-title">Animation example:</div>
  </div>

  <div class="hd">
<!--更详细的api，请参见 ： <a href="../../jsdoc">../../jsdoc</a>-->
    <h1>使用必需配置：</h1>
<pre>
&lt;script&gt;

&lt;script src="http://path/to/loader/loader.js"&gt;&lt;/script&gt;
&lt;script&gt;
__.load('core anim', function() {
  //call anim code here
&lt;/script&gt;
</pre>
  <div id="animTest" style="position:relative;background:#ab3;cursor:move;width:100px;height:100px;">i could go</div>
  <button id="go">go</button><button id="stop">stop</button><br><br>
  <div id="drageTest" style="position:relative;background:#b3a;cursor:move;width:100px;height:100px;">drag me</div>
  </div>
</div>
<script>
__ = {
  cfg : [[], true, '0', '../../../../svn']
};
</script>
<script src="../../src/loader/loader.js"></script>
<script>

__.load('core anim', function() {

  __.Drag.bind('drageTest', true, {
    t : 200, r : 200, b : 0, l :0
  }, function(left, top, zone) {
    (new __.Anim('drageTest', 'top', { to : 0, unit : 'px', onOver : function(){
      (new __.Anim('drageTest', 'left', { to : 0, unit : 'px'})).run();
    }})).run();
  });

  (function() {
    var anim = 'animTest', current,
    goUp = new __.Anim(anim, 'top', { to : -200, unit : 'px', onOver : function(){
      current = goRight;
      current.run();
    }}),
    goRight = new __.Anim(anim, 'left', { to : 200, unit : 'px', onOver : function(){
      current = goDown;
      current.run();
    }}),
    goDown = new __.Anim(anim, 'top', { to : 0, unit : 'px', onOver : function(){
      current = goLeft;
      current.run();
    }}),
    goLeft = new __.Anim(anim, 'left', { to : 0, unit : 'px', onOver : function(){
      current = goUp;
      current.run();
    }});
    __.on('go', 'click', function() {
      if (current) {
        current.run();
      } else {
        current = goUp;
        goUp.run();
      }
    });
    __.on('stop', 'click', function() {
      current.pause();
    });
  }());
});
</script>
</body>
</html>
